
package com.hndfsj.common.domain;

import com.hndfsj.framework.utils.DateUtils;
import java.text.ParseException;
import org.apache.commons.lang.builder.EqualsBuilder;
import org.apache.commons.lang.builder.HashCodeBuilder;
import org.apache.commons.lang.builder.ToStringBuilder;
import org.apache.commons.lang.builder.ToStringStyle;

/**
 * TODO 
 * @copyright {@link www.hndfsj.com}
 * @author ZhengXingJian<Auto generate>
 * @version  2017-04-11 13:46:36
 * @see com.hndfsj.common.domain.ByteResources
 */
public class ByteResources  implements java.io.Serializable {
	
	private static final long serialVersionUID = 5454155825314635342L;

	//date formats
	public static final String ID = "bas_byte_resources.id";
	public static final String ORIGIN_SRC = "bas_byte_resources.origin_src";
	public static final String NAME = "bas_byte_resources.name";
	public static final String BYTES = "bas_byte_resources.bytes";
	public static final String FORMAT_CREATE_TIME = DateUtils.DATETIME_SECOND_FORMAT;
	public static final String CREATE_TIME = "bas_byte_resources.create_time";
	public static final String FORMAT_MODIFY_TIME = DateUtils.DATETIME_SECOND_FORMAT;
	public static final String MODIFY_TIME = "bas_byte_resources.modify_time";
 
	 // idid,
	 // originSrc资源原始URL,
	 // name文件名称,
	 // bytesbytes,
	 // createTimecreateTime,
	 // modifyTime修改时间,
	 
	//columns START
	/**
	 * id
	 */
	private java.lang.String id;
	/**
	 * 资源原始URL
	 */
	private java.lang.String originSrc;
	/**
	 * 文件名称
	 */
	private java.lang.String name;
	/**
	 * bytes
	 */
	private byte[] bytes;
	/**
	 * createTime
	 */
	private java.util.Date createTime;
	/**
	 * 修改时间
	 */
	private java.util.Date modifyTime;
	//columns END
	
	//concstructor

	public ByteResources(){
	}

	public ByteResources(
		java.lang.String id
	){
		this.id = id;
	}

	//get and set
	public void setId(java.lang.String value) {
		this.id = value;
	}
	
	public java.lang.String getId() {
		return this.id;
	}
	public void setOriginSrc(java.lang.String value) {
		this.originSrc = value;
	}
	
	public java.lang.String getOriginSrc() {
		return this.originSrc;
	}
	public void setName(java.lang.String value) {
		this.name = value;
	}
	
	public java.lang.String getName() {
		return this.name;
	}
	public void setBytes(byte[] value) {
		this.bytes = value;
	}
	
	public byte[] getBytes() {
		return this.bytes;
	}
	public String getCreateTimeString() {
		return DateUtils.convertDate2String(FORMAT_CREATE_TIME, getCreateTime());
	}
	public void setCreateTimeString(String value) throws ParseException{
		setCreateTime(DateUtils.convertString2Date(FORMAT_CREATE_TIME,value));
	}
	
	public void setCreateTime(java.util.Date value) {
		this.createTime = value;
	}
	
	public java.util.Date getCreateTime() {
		return this.createTime;
	}
	public String getModifyTimeString() {
		return DateUtils.convertDate2String(FORMAT_MODIFY_TIME, getModifyTime());
	}
	public void setModifyTimeString(String value) throws ParseException{
		setModifyTime(DateUtils.convertString2Date(FORMAT_MODIFY_TIME,value));
	}
	
	public void setModifyTime(java.util.Date value) {
		this.modifyTime = value;
	}
	
	public java.util.Date getModifyTime() {
		return this.modifyTime;
	}
	
	public String toString() {
		return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE)
			.append("Id",getId())
			.append("OriginSrc",getOriginSrc())
			.append("Name",getName())
			.append("Bytes",getBytes())
			.append("CreateTime",getCreateTime())
			.append("ModifyTime",getModifyTime())
			.toString();
	}
	
	public int hashCode() {
		return new HashCodeBuilder()
			.append(getId())
			.toHashCode();
	}
	
	public boolean equals(Object obj) {
		if(obj instanceof ByteResources == false) return false;
		if(this == obj) return true;
		ByteResources other = (ByteResources)obj;
		return new EqualsBuilder()
			.append(getId(),other.getId())
			.isEquals();
	}
}

	
